/*
 * Copyright (C), 2002-2016, 苏宁易购电子商务有限公司
 * FileName: ModelConstant.java
 * Author:   13075787
 * Date:     2016年7月1日 下午3:23:23
 * Description: //模块目的、功能描述      
 * History: //修改记录
 * <author>      <time>      <version>    <desc>
 * 修改人姓名             修改时间            版本号                  描述
 */
package com.suning.sawp.intf.model;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.lang3.StringUtils;

/**
 * 样机管理<br>
 * 常量类
 *
 * @author 13075787
 * @see [相关类/方法]（可选）
 * @since [产品/模块版本] （可选）
 */
public class ModelConstant {

    /**
     * 样机库编码
     */
    public static final String MODEL_LIB = "0007";
    /**
     * 柜台库编码
     */
    public static final String COUNTER_LIB = "8000";
    /**
     * 样机库位编码列表
     */
    public static final Map<String, String> MODEL_LIB_INFOS = new HashMap<String, String>() {
        private static final long serialVersionUID = -9204485493148630715L;

        {
            put(MODEL_LIB, "样机库");
            put(COUNTER_LIB, "柜台库");
        }
    };

    /**
     * 已创建分配任务
     */
    public static final int TASK_CREATE_STATUS_Y = 1;
    /**
     * 未创建分配任务
     */
    public static final int TASK_CREATE_STATUS_N = 0;

    /**
     * 获取指定样机库位编码的文本展示
     */
    public static String getModelLibValue(String code) {
        String msg = ModelConstant.MODEL_LIB_INFOS.get(code);
        if (StringUtils.isBlank(msg)) {
            return "异常";
        }
        return msg;
    }

    /**
     * 样机属性：真机
     */
    public static final Integer MODEL_OBJECT = 1;
    /**
     * 样机属性：样壳
     */
    public static final Integer MODEL_SHELL = 2;
    /**
     * 样机属性：价签出样
     */
    public static final Integer MODEL_LABLE = 3;
    /**
     * 样机属性信息列表
     */
    public static final Map<Integer, String> MODEL_ATTRIBUTE_INFOS = new HashMap<Integer, String>() {
        private static final long serialVersionUID = 2988879985758292999L;

        {
            put(MODEL_OBJECT, "真机");
            put(MODEL_SHELL, "样壳");
            put(MODEL_LABLE, "价签出样");
        }
    };

    /**
     * 获取指定样机属性的文本展示
     */
    public static String getModelAttributeValue(Integer code) {
        String msg = ModelConstant.MODEL_ATTRIBUTE_INFOS.get(code);
        if (StringUtils.isBlank(msg)) {
            return null;
        }
        return msg;
    }

    /**
     * 样机新样标记：新样
     */
    public static final Integer MODEL_NEW = 1;
    /**
     * 样机新样标记：非新样
     */
    public static final Integer MODEL_OLD = 0;
    /**
     * 样机属性信息列表
     */
    public static final Map<Integer, String> MODEL_NEW_FLAG_INFOS = new HashMap<Integer, String>() {
        private static final long serialVersionUID = 2988879985758292999L;

        {
            put(MODEL_NEW, "新样");
            put(MODEL_OLD, "非新样");
        }
    };

    /**
     * 获取出样标识的文本展示
     */
    public static String getModelNewFlagValue(Integer code) {
        String msg = ModelConstant.MODEL_NEW_FLAG_INFOS.get(code);
        if (StringUtils.isBlank(msg)) {
            return "异常";
        }
        return msg;
    }

    /**
     * 是否维护簇商品 是
     */
    public static final int IS_CLUSTER_YES = 1;
    /**
     * 是否维护簇商品 否
     */
    public static final int IS_CLUSTER_NO = 0;
    /**
     * 任务类型 ：总部创建
     */
    public static final int TASK_TYPE_HQ = 1;
    /**
     * 任务类型：大区创建
     */
    public static final int TASK_TYPE_REGION = 2;
    /**
     * 任务操作类型 ：1分配品类
     */
    public static final int TASK_OPR_TYPE_CATE = 1;
    /**
     * 任务操作类型：2分配品牌
     */
    public static final int TASK_OPR_TYPE_BRANCH = 2;
    /**
     * 任务操作类型：3任务执行
     */
    public static final int TASK_OPR_TYPE_HANDLE = 3;
    /**
     * 任务有效状态：0禁用
     */
    public static final Integer TASK_VALID_STATUS_DISABLE = 0;
    /**
     * 任务有效状态：1启用
     */
    public static final Integer TASK_VALID_STATUS_ENABLE = 1;
    /**
     * 任务有效状态信息列表
     */
    public static final Map<Integer, String> TASK_VALID_STATUS_INFOS = new HashMap<Integer, String>() {
        private static final long serialVersionUID = -2245633600731241303L;

        {
            put(TASK_VALID_STATUS_DISABLE, "禁用");
            put(TASK_VALID_STATUS_ENABLE, "启用");
        }
    };

    /**
     * 获取任务有效状态的文本展示
     */
    public static String getTaskValidStatusValue(Integer code) {
        String msg = ModelConstant.TASK_VALID_STATUS_INFOS.get(code);
        if (StringUtils.isBlank(msg)) {
            return "异常";
        }
        return msg;
    }

    /**
     * 任务有效状态：0未开始
     */
    public static final Integer TASK_RUN_STATUS_BEFORE = 0;
    /**
     * 任务有效状态：1进行中
     */
    public static final Integer TASK_RUN_STATUS_ING = 1;
    /**
     * 任务有效状态：2结束
     */
    public static final Integer TASK_RUN_STATUS_END = 2;
    /**
     * 任务分配状态：0未分配
     */
    public static final Integer TASK_ASSIGN_STATUS_NO = 0;
    /**
     * 任务分配状态：1已分配
     */
    public static final Integer TASK_ASSIGN_STATUS_DONE = 1;

    /**
     * 盘点任务提交状态：0未提交
     */
    public static final Integer CHECK_TASK_STATUS_NO = 0;
    /**
     * 盘点任务提交状态：1已提交
     */
    public static final Integer CHECK_TASK_STATUS_DONE = 1;
    /**
     * 盘点任务提交状态：2完成数据比较，删除结束
     */
    public static final Integer CHECK_TASK_STATUS_OVER = 2;

    /**
     * 盘点异常数据处理状态：0处理中
     */
    public static final Integer PROBLEM_OPR_STATUS_ING = 0;
    /**
     * 盘点异常数据处理状态：1处理完成审核中
     */
    public static final Integer PROBLEM_OPR_STATUS_DONE = 1;
    /**
     * 盘点异常数据处理状态：2审核结束
     */
    public static final Integer PROBLEM_OPR_STATUS_OVER = 2;

    /**
     * 样机入库状态：入库
     */
    public static final Integer STORAGE_FLAG_IN = 1;
    /**
     * 样机入库状态：未入库
     */
    public static final Integer STORAGE_FLAG_OUT = 0;

    /**
     * 样机入库状态
     */
    public static final Map<Integer, String> STORAGE_FLAG = new HashMap<Integer, String>() {
        private static final long serialVersionUID = -2245633600731241303L;

        {
            put(STORAGE_FLAG_IN, "是");
            put(STORAGE_FLAG_OUT, "否");
        }
    };
    
    /**
     * 样机盘点状态
     */
    public static final Map<Integer, String> CHECK_TASK_STATUS_MAP = new HashMap<Integer, String>() {

        /**
         */
        private static final long serialVersionUID = 3630097284668442223L;

        {
            put(CHECK_TASK_STATUS_NO, "未提交");
            put(CHECK_TASK_STATUS_DONE, "已提交");
            put(CHECK_TASK_STATUS_OVER, "已对比");
        }
    };
    /**
     * 门店类型：服务站
     */
    public static final Integer STORE_TYPE_SERVICE = 0;
    /**
     * 门店类型：电器店
     */
    public static final Integer STORE_TYPE_ELECTRIC = 1;
    /**
     * 门店类型编码：服务站
     */
    public static final String STORE_TYPE_SERVICE_CODE = "13";

    /**
     * 样机入库状态
     */
    public static final Map<Integer, String> STORE_TYPE_MSG = new HashMap<Integer, String>() {

        /**
         */
        private static final long serialVersionUID = 9052455077077218748L;

        {
            put(STORE_TYPE_SERVICE, "服务站");
            put(STORE_TYPE_ELECTRIC, "电器店");
        }
    };

    /**
     * 获取任务有效状态的文本展示
     */
    public static String getTaskTypeStr(String storeTypeCode) {
        String msg = STORE_TYPE_MSG.get(STORE_TYPE_ELECTRIC);
        if (STORE_TYPE_SERVICE_CODE.equals(storeTypeCode)) {
            msg = STORE_TYPE_MSG.get(STORE_TYPE_SERVICE);
        }
        return msg;
    }

    /**
     * 样机异常处理-处理原因类型:系统已销账顾客未提货
     */
    public static final String PROB_REASON_NO_OUT = "10";
    /**
     * 样机异常处理-处理原因类型:顾客已提货系统未入账
     */
    public static final String PROB_REASON_NO_IN = "11";
    /**
     * 样机异常处理-处理原因类型:库存异常
     */
    public static final String PROB_REASON_INVENTORY = "12";
    /**
     * 样机异常处理-处理原因类型:漏盘点
     */
    public static final String PROB_REASON_NO_CHECK = "20";
    /**
     * 样机异常处理-处理原因类型:样机已撤场
     */
    public static final String PROB_REASON_RETURN = "21";
    /**
     * 样机异常处理-处理原因类型:价签出样
     */
    public static final String PROB_REASON_LABLE = "22";
    /**
     * 样机异常处理-处理原因类型:丢失
     */
    public static final String PROB_REASON_LOSE = "30";
    /**
     * 样机异常处理-处理原因类型:新增样机
     */
    public static final String PROB_REASON_ADD = "40";
    /**
     * 样机库位编码列表
     */
    public static final Map<String, String> PRORB_REASON_INFOS = new HashMap<String, String>() {
        private static final long serialVersionUID = -9204485493148630715L;

        {
            put(PROB_REASON_NO_OUT, "系统已销账顾客未提货");
            put(PROB_REASON_NO_IN, "顾客已提货系统未入账");
            put(PROB_REASON_INVENTORY, "库存异常");
            put(PROB_REASON_NO_CHECK, "漏盘点");
            put(PROB_REASON_RETURN, "样机已撤场");
            put(PROB_REASON_LABLE, "价签出样");
            put(PROB_REASON_LOSE, "丢失");
            put(PROB_REASON_ADD, "新增样机");
        }
    };

    /**
     * 获取指定异常编码的对应文本
     */
    public static String getProbReasonValue(String code) {
        String msg = ModelConstant.PRORB_REASON_INFOS.get(code);
        if (StringUtils.isBlank(msg)) {
            return null;
        }
        return msg;
    }

    /**
     * 商品基本信息品类编码与文案对应信息
     */
    public static final Map<String, String> COMM_CATE_INFOS = new HashMap<String, String>() {
        /**
         */
        private static final long serialVersionUID = 3630097284668442223L;

        {
            put("00001", "空调");
            put("00002", "冰洗");
            put("00003", "黑电");
            put("00004", "数码");
            put("00005", "电脑");
            put("00006", "通讯");
            put("00007", "小家电");
            put("00008", "商用");
            put("00010", "自主产品");
            put("00011", "OA办公");
            put("00012", "运营商");
            put("00013", "厨卫");
            put("00014", "文化制品");
            put("00015", "百货");
            put("00016", "家居");
            put("00017", "虚拟产品");
            put("00018", "金融产品");
            put("00019", "母婴");
            put("00020", "美妆");
            put("00021", "数字应用事业部");
            put("00022", "商旅");
            put("00023", "本地生活");
            put("00024", "移动购物事业部");
            put("00025", "进口保健生鲜");
            put("00026", "配件");
            put("00027", "食品酒水");
            put("00028", "售后事业部");
            put("00029", "医药管事业部");
            put("00050", "期刊目录");
            put("00061", "设备物资");
            put("00062", "办公物资");
            put("00063", "促销物资");
            put("00064", "装修物资");
            put("00065", "物业物资");
            put("00066", "信息设备");
            put("00067", "物业服务");
            put("00068", "后勤服务");
            put("00069", "物流物资");
            put("00071", "工具");
        }
    };

    /**
     * 获取指定异常编码的对应文本
     */
    public static String getCommCateValue(String code) {
        String msg = ModelConstant.COMM_CATE_INFOS.get(code);
        if (StringUtils.isBlank(msg)) {
            return null;
        }
        return msg;
    }

    /**
     * 样机管理-客户端-错误码
     */
    public static final String MODEL_ERROR_NO_PARAM = "E1001";
    /**
     * 样机管理-客户端-错误码
     */
    public static final String MODEL_ERROR_NO_COMM = "E1002";
    /**
     * 样机管理-客户端-错误码
     */
    public static final String MODEL_ERROR_NO_BASE = "E1003";
    /**
     * 样机管理-客户端-错误码
     */
    public static final String MODEL_ERROR_NO_AUTH = "E1004";
    /**
     * 样机管理-客户端-错误码
     */
    public static final String MODEL_ERROR_TASK_EXPIRE = "E2001";
    /**
     * 样机管理-客户端-错误码
     */
    public static final String MODEL_ERROR_NO_TASK = "E2002";

    /**
     * 样机管理-客户端-错误码-盘点的任务不包含该商品
     */
    public static final String MODEL_ERROR_NO_MARCH_COMM = "E2003";
    
    /**
     * 任务有效状态信息列表
     */
    public static final Map<String, String> MODEL_ERRORS = new HashMap<String, String>() {
        /**
         */
        private static final long serialVersionUID = 9052455077077218748L;

        {
            put(MODEL_ERROR_NO_PARAM, "入参缺失");
            put(MODEL_ERROR_NO_COMM, "该商品信息不存在");
            put(MODEL_ERROR_NO_BASE, "该员工基本信息不存在");
            put(MODEL_ERROR_NO_AUTH, "该员工岗位不具备查询此接口的权限");
            put(MODEL_ERROR_TASK_EXPIRE, "该任务已无效");
            put(MODEL_ERROR_NO_TASK, "该员工未被分配此任务");
            put(MODEL_ERROR_NO_MARCH_COMM, "未被分配此商品的盘点任务!");
        }
    };

    /**
     * 获取错误编码对应的文本展示
     */
    public static String getErrorValue(String code) {
        String msg = ModelConstant.MODEL_ERRORS.get(code);
        if (StringUtils.isBlank(msg)) {
            return "异常";
        }
        return msg;
    }

    /**
     * 0
     */
    public static final int NUM_ZERO = 0;
    /**
     * 1
     */
    public static final int NUM_ONE = 1;
    /**
     * 2
     */
    public static final int NUM_TWO = 2;
    /**
     * 3
     */
    public static final int NUM_THREE = 3;
    /**
     * 4
     */
    public static final int NUM_FOUR = 4;
    /**
     * 5
     */
    public static final int NUM_FIVE = 5;
    /**
     * 6
     */
    public static final int NUM_SIX = 6;
    /**
     * 7
     */
    public static final int NUM_SEVEN = 7;
    /**
     * 8
     */
    public static final int NUM_EIGHT = 8;
    /**
     * 9
     */
    public static final int NUM_NINE = 9;
    /**
     * 10
     */
    public static final int NUM_TEN = 10;
    /**
     * 11
     */
    public static final int NUM_ELEVEN = 11;
    /**
     * 12
     */
    public static final int NUM_TWELVE = 12;
    /**
     * 13
     */
    public static final int NUM_THIRTEEN = 13;
    /**
     * 14
     */
    public static final int NUM_FOURTEEN = 14;
    /**
     * 15
     */
    public static final int NUM_FIFTEEN = 15;
    /**
     * 16
     */
    public static final int NUM_SIXTEEN = 16;
    /**
     * 17
     */
    public static final int NUM_SEVENTEEN = 17;
    /**
     * 18
     */
    public static final int NUM_EIGHTEEN = 18;
    /**
     * 19
     */
    public static final int NUM_NINTEEN = 19;
    /**
     * 20
     */
    public static final int NUM_TWENTY = 20;
    /**
     * 21
     */
    public static final int NUM_TWENTY_ONE = 21;
    /**
     * 22
     */
    public static final int NUM_TWENTY_TWO = 22;
    /**
     * 已维护簇标志
     */
    public static final Integer CLUSTER_FLAG_TRUE = 1;
    /**
     * 未维护簇标志
     */
    public static final Integer CLUSTER_FLAG_FALSE = 0;

    /**
     * 审核通过
     */
    public static final Integer AUDIT_PASS = 1;
    /**
     * 审核驳回
     */
    public static final Integer AUDIT_NO = 0;

    /**
     * 未盘点到-文本
     */
    public static final String NO_CHECK_RESULT_STR = "未盘点到";

    /**
     * 任务状态编码-待分配
     */
    public static final String TASK_STATUS_CODE_MF = "f01";
    
    /**
     * 任务状态编码-分配中
     */
    public static final String TASK_STATUS_CODE_YF = "f02";
    
    /**
     * 任务状态编码-待盘点
     */
    public static final String TASK_STATUS_CODE_MP = "p01";
    
    /**
     * 任务状态编码-盘点中
     */
    public static final String TASK_STATUS_CODE_YP = "p02";
    
    /**
     * 任务状态编码-已提交
     */
    public static final String TASK_STATUS_CODE_YT = "j01";
    
    /**
     * 任务状态编码-已结束
     */
    public static final String TASK_STATUS_CODE_JS = "j02";
    
    /**
     * 任务状态名称列表
     */
    public static final Map<String, String> MODEL_TASK_STATUS_STR = new HashMap<String, String>() {
        /**
         */
        private static final long serialVersionUID = 9052455077077218748L;

        {
            put(TASK_STATUS_CODE_MF, "待分配");
            put(TASK_STATUS_CODE_YF, "分配中");
            put(TASK_STATUS_CODE_MP, "待盘点");
            put(TASK_STATUS_CODE_YP, "盘点中");
            put(TASK_STATUS_CODE_YT, "已提交");
            put(TASK_STATUS_CODE_JS, "已结束");
        }
    };
    

    /**
     * 门店类型总编码表
     */
    public static interface STORE_TYPE_INFOS {
        /**
         * 郊区店
         */
        String STORE_TYPE_JQD = "1";
        /**
         * 苏宁云商店
         */
        String STORE_TYPE_SNYSD = "2";
        /**
         * 常规店
         */
        String STORE_TYPE_CGD = "3";
        /**
         * D4类社区店
         */
        String STORE_TYPE_D4LSQD = "4";
        /**
         * EXPO超级店
         */
        String STORE_TYPE_EXPOCJD = "5";
        /**
         * 标准店
         */
        String STORE_TYPE_BZD = "6";
        /**
         * 地区店旗舰店
         */
        String STORE_TYPE_DQDQJD = "7";
        /**
         * 云店
         */
        String STORE_TYPE_YD = "8";
        /**
         * 传统店
         */
        String STORE_TYPE_CTD = "9";
        /**
         * 旗舰店
         */
        String STORE_TYPE_QJD = "10";
        /**
         * 地区旗舰店
         */
        String STORE_TYPE_DQQJD = "11";
        /**
         * 社区店
         */
        String STORE_TYPE_SQD = "12";
        /**
         * 服务站
         */
        String STORE_TYPE_FWZ = "13";
        /**
         * 苏宁生活广场店
         */
        String STORE_TYPE_SNSHGCD = "14";
        /**
         * EXPO超级旗舰店
         */
        String STORE_TYPE_EXPOCJQJD = "15";
        /**
         * 乡镇店
         */
        String STORE_TYPE_CZD = "16";
        /**
         * 地区店
         */
        String STORE_TYPE_DQD = "17";
        /**
         * 超级店
         */
        String STORE_TYPE_CJD = "18";
        /**
         * 红孩子
         */
        String STORE_TYPE_HHZ = "20";
        /**
         * 超市
         */
        String STORE_TYPE_CS = "21";
        /**
         * 苏宁小店
         */
        String STORE_TYPE_SNXD = "22";
        
        public static final Map<String, String> STORE_TYPE_INFOS_MAP = new HashMap<String, String>() {
            private static final long serialVersionUID = -4536373538670855592L;

            {
                put(STORE_TYPE_JQD, "郊区店");
                put(STORE_TYPE_SNYSD, "苏宁云商店");
                put(STORE_TYPE_CGD, "常规店");
                put(STORE_TYPE_D4LSQD, "D4类社区店");
                put(STORE_TYPE_EXPOCJD, "EXPO超级店");
                put(STORE_TYPE_BZD, "标准店");
                put(STORE_TYPE_DQDQJD, "地区店旗舰店");
                put(STORE_TYPE_YD, "云店");
                put(STORE_TYPE_CTD, "传统店");
                put(STORE_TYPE_QJD, "旗舰店");
                put(STORE_TYPE_DQQJD, "地区旗舰店");
                put(STORE_TYPE_SQD, "社区店");
                put(STORE_TYPE_FWZ, "服务站");
                put(STORE_TYPE_SNSHGCD, "苏宁生活广场店");
                put(STORE_TYPE_EXPOCJQJD, "EXPO超级旗舰店");
                put(STORE_TYPE_CZD, "乡镇店");
                put(STORE_TYPE_DQD, "地区店");
                put(STORE_TYPE_CJD, "超级店");
                put(STORE_TYPE_HHZ, "红孩子");
                put(STORE_TYPE_CS, "超市");
                put(STORE_TYPE_SNXD, "苏宁小店");
            }
        };
    }
}
